#include "MySet.hpp"
#include "MyMap.hpp"

using namespace Su;


int main()
{
    Map<int, string> map;
    //Set<int> set;
    map.insert(make_pair(1, "测试用例1"));
    map.insert(make_pair(2, "测试用例1"));
    map.insert(make_pair(999,"测试用例1"));
    map.insert(make_pair(4, "测试用例1"));
    map.insert(make_pair(14, "测试用例1"));
    map.insert(make_pair(-1, "测试用例1"));

    cout << "Is map a map ? :> " << map.IsMap() << endl;


    Map<int, string>::Iterator mit = map.begin();
    //cmit->first = 1; 报错
    mit->second= "修改案例1";
    Map<int, string>::const_Iterator cmit = map.begin();
    //cmit->first = 1;报错
    //cmit->second = "修改案例";报错
    mit++;
    mit->second = "修改案例2";
    map[14] = "通过 [ ] 修改";

    for (const auto& e : map)
    {
        cout << e.first <<  " :> " << e.second << endl;
    }

    /*Map<int, string> map;*/
    Set<int> set;
    set.insert(1);
    set.insert(2);
    set.insert(999);
    set.insert(4);
    set.insert(14);
    set.insert(1);

    cout << "Is set a set ? :> " << set.IsSet() << endl;

    for (const auto& e : set)
    {
        cout << e << " :> " << e << endl;
    }

    Set<int>::Iterator sit = set.begin();
    //*sit = 111; 报错

    return 0;
}